/*
 * overlay 테스트.
 */
Ext.setup({
    tabletStartupScreen:"./tabletStartupScreen.png",
    phoneStartupScreen:"./phoneStartupScreen.png",
    tabletIcon:"./tabletIcon.png",
    phoneIcon:"./phoneIcon.png",
    glossOnIcon: true,
    statusBarStyle:"black",
    fullscreen:true,
    preloadImages:[],
    scope:this,
    onReady: function() {
        var overlayTb = new Ext.Toolbar({
            dock: 'top'
        });
        var overlay = new Ext.Panel({
            floating: true,
            modal: true,
            centered: false,
            width: Ext.is.Phone ? 260 : 400,
            height: Ext.is.Phone ? 220 : 300,
            styleHtmlContent: true,
            dockedItems: overlayTb,
            scroll: 'vertical',
            contentEl: 'lipsum',
            cls: 'htmlcontent'
        });
        var showOverlay = function(btn, event) {
            overlay.setCentered(false);
            overlayTb.setTitle('Attached Overlay');
            overlay.showBy(btn);
        };
        var showCenteredOverlay = function(btn, event) {
            overlay.setCentered(true);
            overlayTb.setTitle('Centered Overlay');
            overlay.show({type:"slide"});
        };
        // top dock menu
        var dockedItems = [{
            dock: 'top',
            xtype: 'toolbar',
            items: [{
                text: 'showBy',
                handler: showOverlay                    
            }]
        },
        // bottom dock menu
        {
            dock: 'bottom',
            xtype: 'toolbar',
            items: [
                {text: 'show (centered)', handler: showCenteredOverlay }, 
                {xtype: 'spacer'}, 
                {text: 'showBy', handler: showOverlay}
            ]
        }];
       //  메인 패널 생성하기.
        new Ext.Panel({
            fullscreen: true,
            dockedItems: dockedItems,
            items:{
                xtype: 'button',
                text: 'Launch Overlay',
                handler:showOverlay
            },
            html: "showBy()테스트~"
        });
    }
});